bbRun 0.0.6  the-R-


bbRun is a configurable run-box plugin for bbLean, and most versions of Blackbox For Windows.

Features:

- Open files, run shell commands, bro@ms, aliases (also for search engines,  and net keywords.)
- Support for variables in Blackbox  environment.
- Optionally shrinks Blackbox memory each time you execute something.
  (This requires NT system) (Based on idea by bladestaylor)
- Act as proxy, allowing to run complete command lines or aliases through Blackbox broadcast messages (bro@ms).
- History.  Most Recent Used command lines. (configurable)
-*
Environment variables can easily increase possibilities to other plugins like bbInterface  for creating more abstract and powerful modules.

* Newest features might have not been added to this document yet. Check out history section in bbrun.txt for details.

Setup:

bbRun currently uses 4 bro@ms,
@bbrun.about
@bbrun.editrc
@bbrun.run
@bbrun.show  
;

the last one shows up the interface (a simple dialog box).

While it can be set as a menu entry ([exec] (Run) {@bbrun.show}), it is recommended to use a bb hotkey (with bbkeys plugin):

KeyToGrab(Escape), WithModifier(Win), WithAction(ExecCommand), DoThis(@bbRun.Show)

or any other key, like 'R' (Windows' Run default hotkey), ...

-bbRun can be set to use only <LWIN> or <RWIN> keys too:

KeyToGrab(LWIN), WithModifier(), WithAction(ExecCommand), DoThis(@bbRun.Show)

without losing focus, and an on/off functionality for this special case.



Interface:

The interface is simple:
-Current directory is seen.
-2 Lines:
run:  where you type the text to be executed.
dir:  executed application's working directory.
-A check box, it enables/disables working directory
-" no * " check box, it enables/disables quickAlias mode.
? button, which shows About box with basic help.
rc button, which opens bbRun.rc for editing.




bbRun modes :

Reference:   [] : text you type;   () : optional;   _ : space

run:
      [file](_[args]) If found, open the desired file.
example:  conv(.lnk) ; firefox(.exe) ; ff(.lnk) ; table.xls ; d:\text1.txt ;
     @[broam] Execute bro@ms
example: @bbcore.about
     ?[search] (Web) Search using default engine. (default: google)
example: ?blackbox linux
    ??[engine]_[search] Use a specific engine. (aliases)
example: ??wiki neon light
     :[address] Net address, no protocol typed (http://, configurable)
example:  :lostinthebox.com
    ::[net](_/[subdir]) Net shortcuts. (aliases)
example: ::xob /plugins.html
     *[alias]
      [alias]
Aliases. (default: * prefix,  optional config for no prefix.)
example:  *cc ;  *cc /f  ;  cc /d
   cd_[path] Change Directory, [path] can be absolute, relative, or %envvar%.
example:  cd e:\music ; cd .. ; cd fonts ; cd %windir%
      [] Shows BB Menu of current directory when nothing is typed.
example: Try yourself pressing <ENTER> key.
   #[file|(*)alias] ... Open file or alias in the %comspec% (cmd.exe or command.com). Configurable.
Useful for console applications, specially if stdout (>) and stderr (2>) redirection is needed.
bbrun.[setting]:[value] Add/edit aliases, or any bbrun.rc setting. If set, you'll see a message box. Useful when you already remember bbrun.rc settings syntax.
example:  bbrun.alias.bbrun?: %BB%\plugins\bbrun\bbrun.html

dir:
      [working dir] Launched application's working directory. If disabled (unchecked) or empty, bbRun doesn't send this information to the shell, and Windows sets it to the current directory.



@bbRun.run: (bbRun as a proxy)

bbRun
can process and run any line sent by another bro@m-sending application, such the bbLean menu, an external command line like  blackbox -exec <bro@m> (bbLean),  or plugins...
The primary use of this bro@m is to add support for Working Directory to bbLean 1.16 and blackbox branches that haven't added this possibility.

syntax:
@bbrun.run #[*alias|file]_[arguments ...] &wd=[working directory]

-Note that '*' is not optional in this case, since bbRun may not run the command if not using quickAlias.
It is recommended to put '*' to make sure it will look for the alias.

-Not all programs use the Working Directory parameter sent by the shell. Some will ignore it, always pointing to "My Documents", some will point to a default folder, some will remember the last directory used...

'&wd='  identifier/delimiter might be configurable in future versions.



bbrun.rc



Dialog box interface:
   
bbrun.currDir:          [path]  (Preset initial/current directory)
bbrun.workDir:          [path]  (Preset application working directory)

bbrun.useWorkDir:       false|true (Checkbox: Enables/disables Working Directory)
bbrun.quickAlias:       false|true
(Checkbox: Alias lookout when no prefix (except #) is specified) 

Other settings: 

bbrun.shrinkMem:        false|true 
(Shrinks blackbox memory allocation when bbRun executes a program)

bbrun.useMRU:           false|true (Enables Most Recent Used lines brosing with <UP> and <DOWN> keys.)
bbrun.MRUItems:         01110000   (Specifies what information the MRU list stores. 0=Off ; 1=On )
                                                                      The 8 items are:   shell-err | shell-ok | bro@m | alias | net | search | dircmd | rcsetting
bbrun.winKey:           false|true (If using <LWIN> or <RWIN> alone as hotkey, this must be set to true.Also enables toggle mode)
bbrun.xy:               false|true (Show dialog box at given x,y coordinates)
bbrun.x:                [x]        (Number: horizontal coordinate)
bbrun.y:                [y]               (Number: vertical coordinate)

bbrun.keepopen:         false|true (Always re-open the dialog box, until you decide to close it.)


bb

Aliases:

bbrun.search:           [engine] (Default Search Engine)
                        run: ?[search]

bbrun.search.[alias]:   [engine] (Added Search Engines)
                        run: ??[alias]_[search]

bbrun.net:              [protocol] (Default Net Protocol) (default 'http://')
                        run: :[address]_([sub])
                          
bbrun.net.[alias]:      [protocol][address]
                        run: ::[alias]_([sub])

bbrun.alias.[alias]:    [anything]
                        run: *[alias]_([more])  (if quickalias = false)
                        or
                        run: [alias]_([more])   (if quickalias = true)

bbrun.quickalias:       false|true (Allows typing aliases without '*' prefix)


Note:
 The '_' are remarks on required spaces, use space instead.
 bbRun may ignore a command if the spacing is incorrect.

Note:
When using 'quickalias', aliases are first priority.
The '*' prefix for aliases can be used all the time .

Then Current Dir or Working Dir if checked, then %Path%.


Environment variables (envvars):

envvars are initialized when plugin is started.

bbRun
automatically creates a variable (you can rename it, but not remove) with the current blackbox path. This is very useful for building up a Blackbox subsystem.


bbrun.BBEnvVar:           [Blackbox variable Name] (default: 'BB')

Also you can set more variables:

bbrun.envvar[number]:     [EnvVarName]=[Value]

Keep the correlative order of [number] and set the variable name and value. Note that '=' sign must be used.
If you set a variable name that already exists in the environment, it will replace its original value while Blackbox is running.

bbrun.pathEnvVar:       %Path%;[more paths]



Example:

bbrun.pathEnvVar:  %Path%;%BB%\mylinks\

this will usually expand to:

Path=%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;[etc...]


In the above example, Path is redefined, including its own current settings (%Path%), plus ';%BB%\mylinks' (an example folder for shortcuts to be accesed from any location.)
Note the ';' sign. (concatenate)

In case you don't know what 'Path' is, it is a Windows variable containing the paths in which the system searches for files when a file is not found at the current folder.

For more info, do a bbRun search "?set path windows"   ;)


(*) bbRun performs a pathEnvVar check every time it's loaded, to make sure it don't repeats itselft multiple times. It works if "%path%;" is at the beginning of the line.

If you change/add an EnvVar / Path setting, you must restart Blackbox.

When you are referring to an [envvar], you must type %[envvar]%. The system/application must expand it, replacing its contents for its name, like an alias.


bbRun envvars are not kept by the system when quit Blackbox.
When you log on, bbRun envvars are not present until Blackbox starts and loads bbRun.
Once set, bbRun envvars are available to Blackbox and any program you start unless you start something a task from the Windows Task Manager. (CTRL+SHIT+ESC)

The main purpose of bbRun envvars is to help making the Blackbox environment easier to set up and more powerful.






Thanks:
-grischka (bbLean, bbSDK: I stole some code from there when I started with bbRun)
-Brad Hughes
-Brian "Tres'ni" Hartvigsen (the cool ideas for broambox, most of which I try to implement in bbRun too)
-John Williamson (uberbox, more great ideas)
-bladestaylor (bbMemshrink plugin - I implemented a similar method.)
-Nightbreed, and people from lostinthebox.com.
-Others I might have forgotten, you know who you are ;)


To do:
-Aliases (specially web search) more powerful, and more simplified perhaps...
-Drag'n Drop. (nothing in mind yet, but the idea sounds cool to me)


Bugs:
This release was tested and bugs were not found, but... one never knows...

Feedback is always appreciated.


History:
See history.txt file.